<!-- 设备资料详情 -->
<template>
	<view class="page" v-if="transInfo">
		<view class="bd-info">
			<view class="col">
				<text class="c-tit">基本信息</text>
			</view>
			<view class="col">
				<text>位置</text>
				<text>{{transInfo.installPosition}}</text>
			</view>
			<view class="col">
				<text>编号</text>
				<text>{{transInfo.num}}</text>
			</view>
			<view class="col">
				<text>容量（kv）</text>
				<text>{{transInfo.approvalLoad}}</text>
			</view>
			<view class="col">
				<text>负荷（kv）</text>
				<text>{{transInfo.curLoad}}</text>
			</view>
			<view class="col" @click="navTo('/pagesEnergy/transformer/transHistory?id='+transId)">
				<text>历史负荷</text>
				<view style="color: #44D94B;">查看更多<u-icon name="arrow-right" class="icon"></u-icon></view>
			</view>
		</view>

		<view class="jctit">
			设备配置列表
		</view>
		<view class="bd-info" style="color: #000;padding: 30rpx;" v-if="bjList.length<1">
			当前无设备配置!
		</view>

		<view class="bd-info" v-for="(item,index) in bjList" :key="index">
			<view class="col">
				<text>部件名称</text>
				<text>{{item.name||'-'}}</text>
			</view>
			<view class="col" >
				<text>部件类型</text>
				<text>{{item.type}}</text>
			</view>
			<view class="col">
				<text>部件型号</text>
				<text>{{item.modal}}</text>
			</view>
			<view class="col">
				<text>数量</text>
				<text>{{item.amount}}</text>
			</view>
			<view class="col" v-if="item.diameter">
				<text>线经</text>
				<text>{{item.diameter}}</text>
			</view>
		</view>


		<view class="trans-info" v-if="transInfo.remark">
			<view class="trans-info-t">
				备注
			</view>
			<view class="dw-col" style="padding: 20rpx 0;">
					{{transInfo.remark}}
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				transInfo: null,
				transId:'',
				bjList:[]
			};
		},
		onLoad(e) {
			this.transId=e.id
			this.apis.energyApi.nyTransCheckInfo(e.id).then(res => {
				this.transInfo = res.data
				this.apis.energyApi.nyTransPart(e.id).then(bjRes=>{
					this.bjList = bjRes.rows
					console.log("this.bjList",this.bjList);
				})
			})
		}
	}
</script>

<style lang="scss">
	.jctit {
		box-sizing: border-box;
		margin:42upx 32upx 0 32upx;
		font-size: 26upx;
		font-family: PingFang-SC-Medium, PingFang-SC;
		font-weight: 500;
		color: #666666;
		margin-bottom: 28rpx;
	}

	.trans-info {
		font-size: 26rpx;
		font-family: PingFang-SC-Medium, PingFang-SC;
		font-weight: 500;
		color: #666666;
		box-sizing: border-box;
		padding: 0 32rpx;
		border-radius: 12rpx;
		background: #FFFFFF;
		overflow: hidden;
		width: 100%;
		height: 100%;
		margin-bottom: 20rpx;

		.dw-col {
			border-bottom: 1px solid #eee;

			&:last-child {
				border: none;
			}

			view {
				padding: 20rpx 0;
				display: flex;
				justify-content: space-between;
				align-items: center;
				flex-direction: row;

				&:last-child {
					border: none;
					padding-bottom: 0;
				}
			}

		}

		.trans-info-t {
			padding: 28rpx 0;
			font-size: 26upx;
			font-family: PingFang-SC-Medium, PingFang-SC;
			font-weight: 500;
			color: #000000;
			position: relative;
			// border-bottom: 1px solid #eee;
			&::after{
				content: "";
				position: absolute;
				bottom: 0;
				left: 0;
				width:calc(100% + 64rpx) ;
				height: 1px;
				transform: translateX(-32upx) scaleY(0.5);
				background-color: #eee;
			}
		}
	}
</style>
